package effect;

import core.MapUtil;
import card.CreatureCard;
/**
 * 
 * @author Oscar
 *
 */
public class FairyDance extends Effect {
	public FairyDance(){
		name="Fairy Dance";
		description="The fairy performs the ancient and magical fairy dance. Heals all other creatures in this land by 1.";
		imageName="cardIconFairyDance.png";
		effectTypes.add(EffectType.activatable);
		targetType = TargetType.none;
		manaCost=5;
	}
	
	@Override
	public void activate(){
		EffectUtil.getCard(this).getOwner().addMana(-5);
		
		CreatureCard temp = (CreatureCard) EffectUtil.getCard(this);
		for(CreatureCard c : MapUtil.getTileOfCard(temp).getCreatures())
			if(c.getCurrentHealth() < c.getBaseHealth())
				c.setCurrentHealth(c.getCurrentHealth()+1);
		System.out.println("Fairy dance");
	}
	
	@Override
	public boolean canActivate(){
		if(EffectUtil.getCard(this).getOwner().getMana()>=5)
			return true;
		else
			return false;
	}
}